๐ฐ Linux Command Cheat Sheet
File Commands
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
SSH (Secure Shell)
-
-
-
-
Searching
-
-
-
-
Process Management
-
-
-
-
-
-
-
File Permissions
-
-
-
Networking
-
-
-
-
Archiving and Compression
-
-
-
-
System Info and Management
-
-
-
-
Misc Commands
-
-
-
-
File Commands
-
ls
- Directory listing-
ls -l
- Long listing format-
ls -a
- List all files including hidden files-
cd /path/to/directory
- Change directory-
pwd
- Display the current working directory-
mkdir directory_name
- Create a new directory-
rmdir directory_name
- Remove an empty directory-
rm file_name
- Remove a file-
rm -r directory_name
- Remove a directory and its contents recursively-
touch file_name
- Create or update a file-
cat file_name
- Concatenate and display the file content-
more file_name
- View file content page by page-
less file_name
- Improved viewing of file content over more
-
cp source_file target_file
- Copy files from source to target-
mv old_name new_name
- Rename or move a file/directorySSH (Secure Shell)
-
ssh user@host
- Connect to host as user-
ssh -p port user@host
- Connect using a specific port-
ssh-keygen -t rsa
- Generate RSA key pair-
ssh-copy-id user@host
- Copy your key to the remote server for password-less loginSearching
-
grep pattern files
- Search for a pattern in files-
grep -r pattern dir
- Recursively search for a pattern in a directory-
find dir -name name*
- Find files starting with name in a directory-
locate file_name
- Find files by name (uses a database)Process Management
-
ps aux
- Display your currently active processes-
ps aux | grep process_name
- Find a process named process_name-
top
- Display all running processes-
kill pid
- Kill a process with a given PID-
killall process_name
- Kill all processes named process_name-
bg
- List stopped or background jobs; resume a stopped job in the background-
fg
- Bring the most recent job to the foregroundFile Permissions
-
chmod +x file_name
- Make a file executable-
chmod 755 file_name
- Set read and execute permissions for owner and read for others-
chown user:group file_name
- Change file owner and groupNetworking
-
ifconfig
- Display all network interfaces and IP addresses-
ping host
- Send ICMP echo request to host-
traceroute host
- Display the route packets take to a network host-
netstat -tulnp
- Display listening ports and their applicationsArchiving and Compression
-
tar cf archive_name.tar files
- Create a tar archive containing files-
tar xf archive_name.tar
- Extract files from a tar archive-
gzip file_name
- Compress a file and rename it to file.gz-
gunzip file.gz
- Decompress file.gz back to the originalSystem Info and Management
-
uname -a
- Show system and kernel info-
df -h
- Display free disk space in a human-readable form-
du -sh directory_name
- Show disk usage of a directory in human-readable form-
free -m
- Show free and used memory in MBMisc Commands
-
man command_name
- Show manual for a command-
echo "text"
- Display a message on the screen-
date
- Display the current date and time-
uptime
- Show how long the system has been runningุฅุฒุงู ุชููุฐ ุงูู Caching ูู Node.jsุ ๐ค
.
.
ูู ุฃูุช ุดุบุงู ุจู Node.jsุ ูู ุฃููุฏ ูุงุจูุช ูู ููู ู ุดููุฉ ุฅู ุงูู API ุนูุฏู ุจูุจูู ุจุทูุก ุจุณุจุจ requests ูุชูุฑ ุฃู ุนู ููุงุช ุชูููุฉ ุฒู queries ุนูู databaseุ ูุจุฏุฃุช ุชููุฑ:
"ููู ูู ู ุฑุฉ ุฃุฌูุจ ููุณ ุงูุฏุงุชุงุ ุทุจ ู ููุด ุญู ุฃุณุฑุนุ"
ุงูุฅุฌุงุจุฉ ูู: Caching.
ูุฏู ุงููู ููุชููู ุนูู ุงูููู ุจุงูุชูุตูู....
[ ูู ุงูุฃููุงุฏ ูุชูุงูููุง ูู ุงูุชุนูููุงุช ุชุญุช ุงูุฑุณุงูุฉ ]
โโโ
๐ฏ ุฅูู ูู ุงูู Cachingุ
ุจุจุณุงุทุฉุ ูู ุฅูู ุชุญูุธ ูุณุฎุฉ ู ู ุงูุฏุงุชุง ู ุคูุชูุง ูู ู ูุงู ุชุงูู (ุจูููู ุฃุณุฑุน ู ู ุงูู ุตุฏุฑ ุงูุฃุณุงุณู ุฒู ุงูู DB)ุ ุนูุดุงู ูู ุง ุชูุฌู ุชุทูุจ ููุณ ุงูุญุงุฌุฉ ุชุงููุ ู ุง ุชุฑูุญ ุชุฌูุจูุง ู ู ุงูุฃููุ ูุงุ ุชุฑุฏ ุจุณุฑุนุฉ ู ู ุงูู cache.
ูุฏู ุจููุฑู ุฌุงู ุฏ ุฌุฏูุง ูู ุงูุณุฑุนุฉุ ูุงูุฃุฏุงุกุ ูุงูุญู ู ุนูู ุงูุณูุฑูุฑ.
โโโ
ุฅุฒุงู ุชุนู ู ุงูู Caching ูู Node.jsุ
1. ุงูู In-Memory Caching (ุจุงุณุชุฎุฏุงู node-cache ุฃู lru-cache)
ูู ุนูุฏู ุฏุงุชุง ู ุด ูุจูุฑุฉ ูู ุด ู ุญุชุงุฌ ุชุดุงุฑููุง ุจูู ุฃูุชุฑ ู ู instanceุ ูู in-memory caching ุจูููู ุญู ุณุฑูุน ูุณูู.
๐ ู ูุงุณุจ ูุญุงูุงุช ุฒู ุงูุฏุงุชุง ุงูููููุฉุ ุฃู ุนู ููุงุช ุญุณุงุจูุฉ ุชูููุฉุ ุจุณ ุฎูู ุจุงูู ุฅูู volatileุ ูุนูู ูู ุงูุณูุฑูุฑ ุนู ู restartุ ูู ุญุงุฌุฉ ุจุชุฑูุญ.
โโโ
2. ุงูู Redis Caching (ุงูุญู ุงูุฃููู ูุงูุฃุดูุฑ)
ูู ุจุชุฏูุฑ ุนูู Cache centralized ูุณุฑูุน ูุชูุฏุฑ ุชุดุงุฑู ุงูุฏุงุชุง ุจูู ุฃูุชุฑ ู ู instanceุ ูุจูู Redis ูู ุงูุฃูุถู ููุง.
๐ฏ ุงูู Redis ุณุฑูุน ุฌุฏูุงุ ูุจูุณุชุฎุฏู ูู ู ุดุงุฑูุน ูุจูุฑุฉ ุฒู Twitter ู GitHub. ููู ุงู ุชูุฏุฑ ุชุชุญูู ูู TTLุ ูุชุนู ู invalidationุ ูุชุฎุฒู ุฃูุชุฑ ู ู ููุน ุฏุงุชุง.
โโโ
3. ุงูู Caching Responses ู ุจุงุดุฑุฉ (ู ุซููุง ูู GraphQL ุฃู REST)
ูู ุดุบุงู ู ุซูุงู ุจู Apollo Server ูู GraphQLุ ุชูุฏุฑ ุชุณุชุฎุฏู built-in caching
ุฃู ุญุชู ูู ุดุบุงู REST ุชูุฏุฑ ุชุณุชุฎุฏู middlewares ุฒู apicache ุฃู express-cache-controller.
โโโ
๐ค ุฅู ุชู ุชุณุชุฎุฏู ุงูู Cachingุ
- ูู ุง ุชููู ุจุชูุฑุฑ ููุณ ุงูู requests ุจูู ูุงุช ูุจูุฑุฉ.
- ูู ุง ุงูุฏุงุชุง ุชููู ู ุด ุจุชุชุบูุฑ ูุชูุฑ.
- ูู ุงูู DB ุนูุฏู ุจุทูุฆุฉ ุฃู ุจุชุงุฎุฏ ููุช ูู ุงูู ุนุงูุฌุฉ.
- ูู ุนุงูุฒ ุชููู ุงูุชุฑุงููู ุนูู ุงูู backend.
โโโ
โ ๏ธ ุฎูู ุจุงูู:
ูุงุฒู ุชุนู ู Cache Invalidation ูููุณุ ุนูุดุงู ู ุง ุชุฑุฌุน ุฏุงุชุง ูุฏูู ุฉ ุจุนุฏ ุงูุชุญุฏูุซ.
ุจูุงุด ุชุณุชุฎุฏู ุงูู Caching ูุฃู ุฏุงุชุง ุญุณุงุณุฉ ุฃู ุดุฎุตูุฉ (privacy first).
ุฎููู ุฏุงูู ูุง ุนุงุฑู ุฅู ุชู ุชุนู ู Cacheุ ูุฅู ุชู ูุง... ู ุด ูู ุญุงุฌุฉ ู ุญุชุงุฌุฉ ุชุชุฎุฒู.
โโโ
ููููู ุงููู ููู ุฎูุฑ ๐ฟ
.
.
ูู ุฃูุช ุดุบุงู ุจู Node.jsุ ูู ุฃููุฏ ูุงุจูุช ูู ููู ู ุดููุฉ ุฅู ุงูู API ุนูุฏู ุจูุจูู ุจุทูุก ุจุณุจุจ requests ูุชูุฑ ุฃู ุนู ููุงุช ุชูููุฉ ุฒู queries ุนูู databaseุ ูุจุฏุฃุช ุชููุฑ:
"ููู ูู ู ุฑุฉ ุฃุฌูุจ ููุณ ุงูุฏุงุชุงุ ุทุจ ู ููุด ุญู ุฃุณุฑุนุ"
ุงูุฅุฌุงุจุฉ ูู: Caching.
ูุฏู ุงููู ููุชููู ุนูู ุงูููู ุจุงูุชูุตูู....
[ ูู ุงูุฃููุงุฏ ูุชูุงูููุง ูู ุงูุชุนูููุงุช ุชุญุช ุงูุฑุณุงูุฉ ]
โโโ
๐ฏ ุฅูู ูู ุงูู Cachingุ
ุจุจุณุงุทุฉุ ูู ุฅูู ุชุญูุธ ูุณุฎุฉ ู ู ุงูุฏุงุชุง ู ุคูุชูุง ูู ู ูุงู ุชุงูู (ุจูููู ุฃุณุฑุน ู ู ุงูู ุตุฏุฑ ุงูุฃุณุงุณู ุฒู ุงูู DB)ุ ุนูุดุงู ูู ุง ุชูุฌู ุชุทูุจ ููุณ ุงูุญุงุฌุฉ ุชุงููุ ู ุง ุชุฑูุญ ุชุฌูุจูุง ู ู ุงูุฃููุ ูุงุ ุชุฑุฏ ุจุณุฑุนุฉ ู ู ุงูู cache.
ูุฏู ุจููุฑู ุฌุงู ุฏ ุฌุฏูุง ูู ุงูุณุฑุนุฉุ ูุงูุฃุฏุงุกุ ูุงูุญู ู ุนูู ุงูุณูุฑูุฑ.
โโโ
ุฅุฒุงู ุชุนู ู ุงูู Caching ูู Node.jsุ
1. ุงูู In-Memory Caching (ุจุงุณุชุฎุฏุงู node-cache ุฃู lru-cache)
ูู ุนูุฏู ุฏุงุชุง ู ุด ูุจูุฑุฉ ูู ุด ู ุญุชุงุฌ ุชุดุงุฑููุง ุจูู ุฃูุชุฑ ู ู instanceุ ูู in-memory caching ุจูููู ุญู ุณุฑูุน ูุณูู.
๐ ู ูุงุณุจ ูุญุงูุงุช ุฒู ุงูุฏุงุชุง ุงูููููุฉุ ุฃู ุนู ููุงุช ุญุณุงุจูุฉ ุชูููุฉุ ุจุณ ุฎูู ุจุงูู ุฅูู volatileุ ูุนูู ูู ุงูุณูุฑูุฑ ุนู ู restartุ ูู ุญุงุฌุฉ ุจุชุฑูุญ.
โโโ
2. ุงูู Redis Caching (ุงูุญู ุงูุฃููู ูุงูุฃุดูุฑ)
ูู ุจุชุฏูุฑ ุนูู Cache centralized ูุณุฑูุน ูุชูุฏุฑ ุชุดุงุฑู ุงูุฏุงุชุง ุจูู ุฃูุชุฑ ู ู instanceุ ูุจูู Redis ูู ุงูุฃูุถู ููุง.
๐ฏ ุงูู Redis ุณุฑูุน ุฌุฏูุงุ ูุจูุณุชุฎุฏู ูู ู ุดุงุฑูุน ูุจูุฑุฉ ุฒู Twitter ู GitHub. ููู ุงู ุชูุฏุฑ ุชุชุญูู ูู TTLุ ูุชุนู ู invalidationุ ูุชุฎุฒู ุฃูุชุฑ ู ู ููุน ุฏุงุชุง.
โโโ
3. ุงูู Caching Responses ู ุจุงุดุฑุฉ (ู ุซููุง ูู GraphQL ุฃู REST)
ูู ุดุบุงู ู ุซูุงู ุจู Apollo Server ูู GraphQLุ ุชูุฏุฑ ุชุณุชุฎุฏู built-in caching
ุฃู ุญุชู ูู ุดุบุงู REST ุชูุฏุฑ ุชุณุชุฎุฏู middlewares ุฒู apicache ุฃู express-cache-controller.
โโโ
๐ค ุฅู ุชู ุชุณุชุฎุฏู ุงูู Cachingุ
- ูู ุง ุชููู ุจุชูุฑุฑ ููุณ ุงูู requests ุจูู ูุงุช ูุจูุฑุฉ.
- ูู ุง ุงูุฏุงุชุง ุชููู ู ุด ุจุชุชุบูุฑ ูุชูุฑ.
- ูู ุงูู DB ุนูุฏู ุจุทูุฆุฉ ุฃู ุจุชุงุฎุฏ ููุช ูู ุงูู ุนุงูุฌุฉ.
- ูู ุนุงูุฒ ุชููู ุงูุชุฑุงููู ุนูู ุงูู backend.
โโโ
โ ๏ธ ุฎูู ุจุงูู:
ูุงุฒู ุชุนู ู Cache Invalidation ูููุณุ ุนูุดุงู ู ุง ุชุฑุฌุน ุฏุงุชุง ูุฏูู ุฉ ุจุนุฏ ุงูุชุญุฏูุซ.
ุจูุงุด ุชุณุชุฎุฏู ุงูู Caching ูุฃู ุฏุงุชุง ุญุณุงุณุฉ ุฃู ุดุฎุตูุฉ (privacy first).
ุฎููู ุฏุงูู ูุง ุนุงุฑู ุฅู ุชู ุชุนู ู Cacheุ ูุฅู ุชู ูุง... ู ุด ูู ุญุงุฌุฉ ู ุญุชุงุฌุฉ ุชุชุฎุฒู.
โโโ
ููููู ุงููู ููู ุฎูุฑ ๐ฟ
Top 5 JavaScript Design Patterns Every Front End Developer Must Know ๐